home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / pdcurs21.zip / PRIVATE.ZIP / _PUTCTTY.C < prev    next >
Text File  |  1992-11-21  |  2KB  |  59 lines

  1. #define        CURSES_LIBRARY  1
  2. #include <curses.h>
  3.  
  4. #ifndef        NDEBUG
  5. char *rcsid__putctty = "$Header: c:/curses/private/RCS/_putctty.c%v 2.0 1992/11/15 03:24:30 MH Rel $";
  6. #endif
  7.  
  8.  
  9.  
  10.  
  11. /*man-start*********************************************************************
  12.  
  13.   PDC_putctty()        - Output a character and attribute in TTY fashion.
  14.  
  15.   PDCurses Description:
  16.        This is a private PDCurses routine.
  17.  
  18.        Outputs character 'chr' to screen in tty fashion. If a colour
  19.        mode is active, the character is written with colour 'colour'.
  20.  
  21.        This function moves the physical cursor after writing so the
  22.        screen will scroll if necessary.
  23.  
  24.   PDCurses Return Value:
  25.        This function returns OK on success and ERR on error.
  26.  
  27.   PDCurses Errors:
  28.        No errors are defined for this function.
  29.  
  30.   Portability:
  31.        PDCurses        int PDC_putctty( chtype character, chtype color );
  32.  
  33. **man-end**********************************************************************/
  34.  
  35. int    PDC_putctty( chtype character, chtype color )
  36. {
  37. #ifdef FLEXOS
  38.        int     x = color;
  39.        retcode = s_write(0x00, 0x01L, (_far char *) &character, 1L, 0);
  40.        return( (retcode < 0L) ? ERR : OK );
  41. #endif
  42. #ifdef DOS
  43.        regs.h.ah = 0x0e;       /* Write in TTY fashion, advance cursor. */
  44.        regs.h.al = (unsigned char) (character & A_CHARTEXT);
  45.        regs.h.bh = _cursvar.video_page;
  46.        regs.h.bl = (unsigned char) ((color & A_ATTRIBUTES) >> 8);
  47.        int86(0x10, ®s, ®s);
  48.        return( OK );
  49. #endif
  50. #ifdef OS2
  51.        int curRow = PDC_get_cur_row ();
  52.        int curCol = PDC_get_cur_col ();
  53.  
  54.        VioWrtTTY ((PCH)&character, 1, 0);
  55.        VioWrtNAttr ((PBYTE)&color, 1, (USHORT)curRow, (USHORT)curCol, 0);
  56.        return( OK );
  57. #endif
  58. }
  59.